#ifndef _BUOLA_CHART_CCHART_H_
#define _BUOLA_CHART_CCHART_H_

#include <buola/chart.h>
#include <buola/gui/cwindow.h>

namespace buola { namespace chart {

//!base class for charts... is now a window!
class CChart : public gui::CWindow
{
public:
    enum EStyle
    {
        STYLE_NONE=0,
        BOX=(1<<0),
        CENTER=(1<<1),
        LEGEND=(1<<2),
        MOUSEINFO=(1<<3),
        THIN=(1<<4),
    };
    DECLARE_FRIEND_ENUM_BITOPS(EStyle)

public:
    CChart();
    virtual ~CChart();
    
public:
///\name properties
//@{
    ///set frame color
    void SetFrameColor(const img::CColor &pColor);
    const img::CColor &FrameColor()     {   return mFrameColor; }
    
    //!set style flags
    void SetStyle(EStyle pStyle)        {   mStyle=pStyle;  }
    //!get style flags
    EStyle Style()                   {   return mStyle;  }
    //!check if some flag bit(s) are set
    bool Style(EStyle pBit)       {   return ((mStyle&pBit)==pBit);   }

    //!toggle legend
    void ToggleLegend();
    
    void FillMenu(gui::PMenu pMenu);
    
    const img::PFont &Font()    {   return mFont;   }

private:
    EStyle mStyle;
    img::CColor mFrameColor;
    img::PFont mFont;
};

/*namespace chart*/ } /*namespace buola*/ }

#endif
